package com.likeyoudo.views.enums;


import com.likeyoudo.views.R;

/**
 * @author LikeYouDo
 * @date 2023/11/29 14:53
 */
public enum PageEnum {
    PUBLIC_SERVICE_APPROVAL("approval", R.layout.fragment_public_service_approval),
    ;

    private String path;
    private int layoutId;

    PageEnum(String path, int layoutId) {
        this.path = path;
        this.layoutId = layoutId;
    }

    /**
     * 根据router的path获取对应的layoutId
     * @param path
     * @return
     */
    public static int getResId(String path) {
        for (PageEnum value : PageEnum.values()) {
            if (value.path.equals(path)) {
                return value.layoutId;
            }
        }
        // 为空则默认,首页
        return R.layout.fragment_index;
    }
}
